package sy7;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Scanner;

public class Sy72 {
	public static void main(String[] args) {
		Scanner input=new Scanner(System.in );
		List list=new ArrayList<String>();
		while(input.hasNext()){
			String str=input.next();
			if(str.equals("!!!!!"))
				break;
			if(!list.contains(str))
				list.add(str);
		}
		System.out.println(list.size());
		Collections.sort(list);
		if(list.size()>10){
			for(int i=0;i<10;i++){
				System.out.println((String) list.get(i));
			}		
		}
		else{
			for(int j=0;j<10;j++)
				System.out.println((String)list.get(j));
		}
				
	}

}
